#legacySQL
SELECT event_dim.name as event, EXACT_COUNT_DISTINCT(user_dim.app_info.app_instance_id) as user
FROM [com_seongyun_app.app_events_20171001]
GROUP BY event
ORDER BY user DESC
#legacySQL
SELECT event_dim.name as event, EXACT_COUNT_DISTINCT(user_dim.app_info.app_instance_id) as user
FROM TABLE_DATE_RANGE(com_seongyun_app.app_events_, TIMESTAMP('20170901'), TIMESTAMP('20171001'))
GROUP BY event
ORDER BY user DESC
#standardSQL
SELECT event_dim.name as event, COUNT(DISTINCT user_dim.app_info.app_instance_id) as user
FROM `com_seongyun_app.app_events_*`
WHERE _table_suffix between '20170901' and '20171001'
GROUP BY event
ORDER BY user DESC
instance_id | event_name | name |
---|---|---|
A | Save_Name | firebase |
B | Save_Name | bigquery |
C | Save_Name | firebase |
D | Save_Name | seongyun |
#legacySQL
SELECT user_dim.app_info.app_instance_id AS instance_id, event_dim.name AS event_name,
MAX(IF(event_dim.params.key = 'name', event_dim.params.value.string_value, null)) as name
FROM [com_seongyun_app.app_events_20171001]
GROUP BY instance_id, event_name